package com.wanhe.shoppingcart.bean;

import java.util.ArrayList;

/**
 * Created by XieZaiWei on 2017/5/9.
 * 购物车展示的菜品
 */

public class CartShowItem {
	/**
	 * 菜品分类的名称
	 */
	private String title;
	/**
	 * 菜品分类的id
	 */
	private String typeId;
	/**
	 * 餐饮系统的菜品类型编号
	 */
	private String typeNO;
	/**
	 * 同一菜品分类下的子菜品列表
	 */
	private ArrayList<CartItem> arrCartItem;

	public CartShowItem(){
		arrCartItem = new ArrayList<>();
	}

	public ArrayList<CartItem> getArrCartItem() {
		return arrCartItem;
	}

	public void setArrCartItem(ArrayList<CartItem> arrCartItem) {
		this.arrCartItem = arrCartItem;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTypeId() {
		return typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}

	public String getTypeNO() {
		return typeNO;
	}

	public void setTypeNO(String typeNO) {
		this.typeNO = typeNO;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof CartShowItem){
			CartShowItem cartShowItem = (CartShowItem)obj;
			return this.typeId.equals(cartShowItem.getTypeId());
		}
		return false;
	}

	@Override
	public int hashCode() {
		return this.typeId.hashCode();
	}
}
